"""
@Project:xiaomishop
@File:search_indexes.py
@Author:马可
@Date:上午 09:41
"""
from haystack import indexes

from goods.models import Goods
class GoodsIndex(indexes.SearchIndex,indexes.Indexable):
    # 商品索引
    text = indexes.CharField(document=True,use_template=True)

    def get_model(self):
        return Goods

    def index_queryset(self, using=None):
        return self.get_model().objects.all()
